<template>
  <uni-nav-bar title="地区差异表" left-icon="left" @clickLeft="navBack" :fixed="true" statusBar></uni-nav-bar>
  <view class="package space-between" style="padding:30rpx 20rpx;" v-for="item in priceList" :key='item.id'>
    <view>{{item.name}}</view>
    <view>当前地区价格{{item.price}}元/吨</view>
  </view>
</template>

<script setup lang="ts">
  import { navBack } from '@/utils/navigator';
  import { ref } from 'vue';
  import { showLoading } from '@/utils/prompt';
  import { toPublish } from '@mqtt';
  import { getFleetPrice } from '@/gql/fleet';
  const priceList = ref([])
  init()
  function init() {
    showLoading()
    const payload = {
      query: getFleetPrice,
    };
    toPublish(
      'ql/driver/getFleetPrice',
      payload,
      (obj : any) => {
        const { getFleetPrice } = obj.data;
        priceList.value = getFleetPrice
      }
    );
  }
</script>

<style scoped lang="less">
</style>